<?php

namespace App\Http\Controllers\Api;

use App\Http\Resources\ScoreResource;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class ScoreController extends Controller
{
    public function index(Request $request)
    {
        $user = \Auth::user();
        $result = $user->scores()->orderBy('id', 'desc')->paginate();
        $resource = ScoreResource::collection($result);

        return api(RET_OK, MSG_OK, $resource);
    }
}
